package model;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the ITEM_PERIODO_ALQUILER database table.
 * 
 */
@Embeddable
public class ItemPeriodoAlquilerPK implements Serializable {
	//default serial version id, required for serializable classes.
	private static final long serialVersionUID = 1L;

	@Column(name="ITEM_ID", insertable=false, updatable=false, unique=true, nullable=false)
	private long itemId;

	@Column(name="PERIODO_ALQUILER_ID", insertable=false, updatable=false, unique=true, nullable=false)
	private long periodoAlquilerId;

	public ItemPeriodoAlquilerPK() {
	}
	public long getItemId() {
		return this.itemId;
	}
	public void setItemId(long itemId) {
		this.itemId = itemId;
	}
	public long getPeriodoAlquilerId() {
		return this.periodoAlquilerId;
	}
	public void setPeriodoAlquilerId(long periodoAlquilerId) {
		this.periodoAlquilerId = periodoAlquilerId;
	}

	public boolean equals(Object other) {
		if (this == other) {
			return true;
		}
		if (!(other instanceof ItemPeriodoAlquilerPK)) {
			return false;
		}
		ItemPeriodoAlquilerPK castOther = (ItemPeriodoAlquilerPK)other;
		return 
			(this.itemId == castOther.itemId)
			&& (this.periodoAlquilerId == castOther.periodoAlquilerId);
	}

	public int hashCode() {
		final int prime = 31;
		int hash = 17;
		hash = hash * prime + ((int) (this.itemId ^ (this.itemId >>> 32)));
		hash = hash * prime + ((int) (this.periodoAlquilerId ^ (this.periodoAlquilerId >>> 32)));
		
		return hash;
	}
}